package com.kingcat.smartchair;

import android.content.ContentProvider;
import android.content.ContentValues;
import android.database.Cursor;
import android.net.Uri;
import android.provider.Settings;

// 内容提供者 主要用來為愛奇藝提供UDID獲取
public class UDIDContentProvider extends ContentProvider {
    @Override
    public boolean onCreate() {
        //mDB = new DbOpenHelper(getContext()).getReadableDatabase();

        //mDB.execSQL("insert into udid values (1,'android')");
        return true;
    }

    @Override
    public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
        String tableName = "udid";
        return null;
    }

    // 借用getType 方法返回UDID
    @Override
    public String getType(Uri uri) {
        return Settings.Secure.getString(getContext().getContentResolver(), Settings.Secure.ANDROID_ID);

        //return "test";
    }

    @Override
    public Uri insert(Uri uri, ContentValues values) {
        return null;
    }

    @Override
    public int delete(Uri uri, String selection, String[] selectionArgs) {
        return 0;
    }

    @Override
    public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
        return 0;
    }
}
